<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('预报文件元数据(新功能)列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>NC文件名：</label>
                                <input type="text" name="ncname"/>
                            </li>
                          <!--  <li>
                                <label>来源：</label>
                                <input type="text" name="ly"/>
                            </li>-->
                            <li>
                                <label>类型：</label>
                                <input type="text" name="lx"/>
                            </li>
                            <!--<li>
                                <label>起报时间：</label>
                                <input type="text" class="time-input" placeholder="请选择起报时间" name="qbsj"/>
                            </li>-->
                         <!--   <li>
                                <label>预报时效：</label>
                                <input type="text" name="ybsj"/>
                            </li>-->
                            <li>
                                <label>预报频次：</label>
                                <input type="text" name="ybpc"/>
                            </li>
                           <!-- <li>
                                <label>覆盖范围：</label>
                                <input type="text" name="fgfw"/>
                            </li>
                            <li>
                                <label>空间分辨率：</label>
                                <input type="text" name="kjfbl"/>
                            </li>-->
                            <li>
                                <label>预报要素：</label>
                                <input type="text" name="ybys"/>
                            </li>
                          <!--  <li>
                                <label>入库时间：</label>
                                <input type="text" name="rksj"/>
                            </li>
                            <li>
                                <label>入库状态(0未完成检验  1完成检验)：</label>
                                <input type="text" name="rkzt"/>
                            </li>
                            <li>
                                <label>预报数据位置：</label>
                                <input type="text" name="ybsjwz"/>
                            </li>-->
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:rwpgmetadata:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:rwpgmetadata:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:rwpgmetadata:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:rwpgmetadata:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" style="font-size: 10px"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:rwpgmetadata:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:rwpgmetadata:remove')}]];
        var prefix = ctx + "system/rwpgmetadata";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",

                modalName: "预报文件元数据(新功能)",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '文件编码',
                    /*visible: false*/
                },
                {
                    field: 'ncname',
                    title: '文件名'
                },
                {
                    field: 'ly',
                    title: '来源'
                },
                {
                    field: 'lx',
                    title: '类型'
                },
                {
                    field: 'qbsj',
                    title: '起报时间'
                },
                {
                    field: 'ybsj',
                    title: '预报时效'
                },
                {
                    field: 'ybpc',
                    title: '预报频次'
                },
                {
                    field: 'fgfw',
                    title: '覆盖范围'
                },
                {
                    field: 'kjfbl',
                    title: '空间分辨率'
                },
             /*   {
                    field: 'ybys',
                    title: '预报要素'
                },*/
                {
                    field: 'rksj',
                    title: '入库时间'
                },
                {
                    field: 'rkzt',
                    title: '入库状态',
                    formatter: function(value, row, index) {
                        if (value == '1'){
                            return "<p style='color: #00a65a'>处理完成</p>"
                        }else if(value == '0'){
                            return "<p style='color: #ff0026'>处理失败</p>";
                        }else{
                            return "<p style='color: #d3d300'>处理中</p>";
                        }
                    }
                },
               /* {
                    field: 'ybsjwz',
                    title: '预报数据位置'
                },*/
                    {
                        title: '任务',
                        align: 'center',
                        formatter: function(value, row, index) {
                            var actions = [];
                            //actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>任务列表</a> ');
                            actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-list-ul"></i>列表</a> ');
                            return actions.join('');
                        }
                    }
               /* {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }*/]
            };
            $.table.init(options);
        });

        /*字典列表-详细*/
        function detail(yid) {
            var url = prefix + '/detail/' + yid;
            $.modal.open("预报任务", url,1300,800);
        }

    </script>
</body>
</html>